import { TablePaginationConfig } from 'antd'
export const initialState: TablePaginationConfig = {
  current: 1,
  pageSize: 10,
  pageSizeOptions: ['10', '20', '50', '100'],
  total: 0,
  showSizeChanger: true,
  showQuickJumper: true,
  showTotal: (total: number) => `合计 ${total} 人`,
  size: 'small'
}

export function reducer (state: TablePaginationConfig, action: { type: string, data: any }): TablePaginationConfig {
  return {
    ...state,
    [action.type]: action.data
  }
}
